<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateVendor extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        \DB::statement('CREATE TABLE `purchase_vendor` (
  `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
  `tel` text COLLATE utf8mb4_unicode_ci COMMENT \'办公电话\',
  `country` char(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT \'国家\',
  `province` char(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT \'省/州\',
  `city` char(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT \'城市\',
  `addr` text COLLATE utf8mb4_unicode_ci COMMENT \'地址\',
  `manager` text COLLATE utf8mb4_unicode_ci COMMENT \'联系人\',
  `manager_email` text COLLATE utf8mb4_unicode_ci COMMENT \'电话\',
  `manager_phone` text COLLATE utf8mb4_unicode_ci COMMENT \'邮箱\',
  `status` tinyint(1) NOT NULL DEFAULT \'0\' COMMENT \'状态\',
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updated_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`),
  KEY `status` (`status`),
  KEY `created_at` (`created_at`),
  KEY `updated_at` (`updated_at`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;');
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('vendor');
    }
}
